<template>
  <div class="userlogin">
    <div class="head">
      <h1>用户详情</h1>
      <span @click="back">
        <img src="../assets/img/fhui.png" alt="">
      </span>
    </div>
    <div class="content">
      <div class="useritem">
        <div class="nav">
          <div class="left">
            <div class="img">
              <img src="../assets/img/1.webp" alt="" />
            </div>
            <h2>handsomeboy</h2>
          </div>
          <div class="right">
            <img src="../assets/img/1.png" alt="" />
          </div>
        </div>
      </div>
      <div class="session">
        <ul>
          <li>
            <p>名字</p>
            <h3>handsomeboy</h3>
            <div class="img">
              <img src="../assets/img/right.png" alt="" />
            </div>
          </li>
          <li>
            <p>邮箱</p>
            <h3>未关联</h3>
            <div class="img">
              <img src="../assets/img/right.png" alt="" />
            </div>
          </li>
          
        </ul>
      </div>
       <div class="session" style="margin-top:30px">
        <ul>
          <li>
            <p>设置密码</p>
            <div class="img">
              <img src="../assets/img/right.png" alt="" />
            </div>
          </li>
        </ul>
      </div>
      <div class="quit">
          <div class="text" @click="quit">
            退出登录
          </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
    methods: {
        quit(){
            // 清空全部localstorage
            // window.localStorage.clear()



            // 清空指定localstorage
            localStorage.removeItem('token')
             
              this.$router.push('/cart')
              window.localStorage.setItem("btindex",3);
        },
        back(){
            this.$router.go(-1)
        },
       
    },
};
</script>

<style lang="scss" scoped>
.userlogin {
  .head {
    width: 100%;
    height: 50px;
    border-bottom: 1px solid #dbdbdb;
    position: relative;
    h1 {
      width: 70%;
      margin: 0 auto;
      text-align: center;
      line-height: 50px;
      color: rgba(0, 0, 0, 0.6);
      font-size: 18px;
      font-weight: 700;
    }
    span{
        display: block;
        position: absolute;
        top: 8px;
        left: 20px;
        img{
            width: 30px;
        }
    }
  }
  .content {
    width: 100%;
    background-color: rgb(240, 240, 240);
    height: 600px;
    .useritem {
      width: 90%;
      
      margin: 0 auto;
      background-color: #fff;
      border-radius: 10px;
      position: relative;
      top: 20px;

      .nav {
        width: 100%;
        height: 90px;

        display: flex;

        .left {
          display: flex;
          width: 90%;
          margin: 0 auto;
          height: 60px;
          padding: 15px 0;
          .img {
            width: 20%;
            height: 60px;
            border: 50%;
            border-radius: 50%;
            overflow: hidden;
            margin-left: 20px;
            img {
              width: 100%;
              height: 60px;
            }
          }
          h2 {
            height: 60px;
            flex: 1;
            line-height: 60px;
            margin-left: 20px;
            font-weight: 700;
            font-size: 20px;
          }
        }
        .right {
          width: 10%;
          display: flex;
          height: 60px;
          padding: 15px 0;
          flex-direction: column;
          justify-content: center;
          img {
            width: 30%;
            height: 30%;
            display: block;
            margin: 0 auto;
          }
        }
      }
    }
     .session{
        width: 90%;
        margin: 0 auto;
        background-color: #fff;
        border-radius: 10px;
        ul{
            li{
                width: 100%;
                height: 60px;
                display: flex;
               
               
                p{
                    width: 50%;
                    height: 30px;
                    line-height: 30px;
                    padding: 15px;
                    font-size: 18px;
                    color: #4f4e4e;
                    margin-left: 20px;
                    flex: 1;
                }
                h3{
                    width: 20%;
                    height: 30px;
                    line-height: 30px;
                     padding: 15px;
                    font-size: 14px;
                    color: #4f4e4e;
                }
                .img{
                    width: 10%;
                     height: 20px;
                  
                    padding: 20px 2px;
                   
                    img{
                          width: 30%;
                           height: 20px;
                          display: block;
                          margin: 0 auto;
                         
                    }
                }
            }
        }
    }
    .quit{
          width: 90%;
        margin: 0 auto;
        margin-top: 30px;
          background-color: rgb(227, 95, 86);
        border-radius: 10px;
         .text{
            padding: 20px;
            text-align: center;
            color: white;
            font-weight: 700;
            font-size: 18px;
         }
    }
  }
}
</style>